#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <conio.h>  
#include <string.h>
using namespace std;


class User {

private:
	static int cnt;
	int id;
	char *name;
	char pwd[10];
public:
	User(){
		id = cnt++;
		strcpy(pwd, "Aa000000");
		name = new char[100];
		strcpy(name, "User");
	}

	void setName(){
		printf("Input Username:\n");
		char temp[100];
		cin >> temp;
		strcpy(name, temp);
	}

	bool setPassword() {
		printf("Input Previous Password:\n");
		char pre[100];
		cin >> pre;

		bool ok = false;
		if(strcmp(pre, pwd) == 0){
			printf("Input New Password:\n");
			char p[100];
			cin >> p;
			if(isValid(p)){
				strcpy(pwd, p);
				ok = true;
			}
		}
		return ok;
	}

	bool isValid(char *p){
		int len = strlen(p);
		if(len > 8){
			return false;
		}
		bool letter = false, cap = false, digit = false;
		
		for(int i = 0; i < len; ++i){
			char c = p[i];
			if('a' <= c && c <= 'z'){
				letter = true;
			}
			if('A' <= c && c <= 'Z'){
				cap = true;
			}
			if('0' <= c && c <= '9'){
				digit = true;
			}
		}
		return letter && cap && digit;
	}

	void show() {
		printf("\nId : %d \nUserName: %s \n", id, name);
	}

	~User() {
		delete [] name;  // delete name;
	}

};

int User::cnt = 1;

void solve(){
	
	User user;
	user.setName();
	printf("Change Password ? y / n\n");
	
	char c;
	while((c = getch()) == 'y'){
		if(user.setPassword()){
			printf("Status: OK\n");
		}else{
			printf("Invalid Password\n");
		}

		printf("Change Password ? y / n\n");
	}
	user.show();
}

int main(){

	solve();
    return 0;
}